package com.teachoa.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.teachoa.bean.Dict;

public class DictUtil {
	
	public static Map<Integer, String> getDictMapByPath(String path) {
		List<Dict> dictList = Dict.dao.getSubDictsByPath(path);
		Map<Integer, String> dictMap = new HashMap<Integer, String>();
		for(Dict dict:dictList) {
			dictMap.put(dict.getInt("value"), dict.getStr("name"));
		}
		return dictMap;
	}
	
	public static List<Dict> getSubDictsByPath(String path) {
		return Dict.dao.getSubDictsByPath(path);
	}

}
